import sys
import os

# 添加backend目录到Python路径
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'backend'))

from app import create_app, db

if __name__ == '__main__':
    app = create_app()
    
    with app.app_context():
        # 创建数据库表
        db.create_all()
        print("数据库表创建成功！")
    
    print("启动Flask应用...")
    print("访问地址: http://localhost:5000")
    app.run(debug=True, host='0.0.0.0', port=5000)
